<?php
echo"<pre>";
$dbms="mysql";
$server="localhost";
$username="root";
$password="";
$dbname="account_pdo_db";
$dsn ="$dbms:host=$server;dbname=$dbname";
try{
	$pdo=new PDO($dsn,$username,$password);
	echo"PDO连接MySQL数据库服务器成功";
	//命名参数
	$pre=$pdo->prepare("insert into account(username,password,email)values(:name,:pwd,:email)");
	$name ="hali";
	$pwd ="00544abc";
	$email ="00544@qq.com";
	$pre->bindParam(":name",$name);
	$pre->bindParam(":pwd",$pwd);
	$pre->bindParam(":email",$email);
	$pre->execute();
	$name = "luoenee";
	$pre->execute (array(
	":name"=>$name,
	":pwd"=>"love",
	"email"=>"love@qq.com"
	));
	$pdo =null;
	//数据站位符
	
	echo"添加成功";
}catch(PDDExecption $e){
	echo"PDD连接MySQL数据库失败";
	die();
}
?>